<template>
  <div>
    <navigation>收益明细</navigation>
    <div v-if="list.length>0" class="list">
      <div v-for="(item, index) in list" :key="index" class="profit-item">
        <div class="title">{{ item.memo }}</div>
        <div class="info">{{ item.ctime }}</div>
      </div>
    </div>
    <div v-else class="no-data">暂无数据</div>
  </div>
</template>

<script>
import { mapActions } from 'vuex'
import navigation from '@/components/Navigation'
export default {
  components: { navigation },
  data () {
    return {
      list: []
    }
  },
  mounted () {
    this.handerWeathProfit()
  },
  methods: {
    ...mapActions({
      weathProfit: 'weath/weathProfit'
    }),
    handerWeathProfit () {
      this.weathProfit()
        .then((data) => {
          if (data.data) {
            this.list = data.data
          }
        })
    }
  }
}
</script>

<style scoped>
.list {margin-top: 90px;overflow-y: auto;height: calc(100vh - 90px);}
.profit-item {
  padding: 10px 15px;
  box-shadow: 0 0 15px -5px rgba(0, 0, 0, .05);
  margin: 10px 0;
}
.profit-item .title {
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 5px;
}
.profit-item .info {
  font-size: 12px;color: #999
}
.no-data {
  margin-top: 100px;
  text-align: center;
  line-height: 3;
  color: #666666;
  font-size: 14px;
}
</style>
